<!doctype html>
<html>
<head>
<script type="text/javascript" src="lib/blockad.js"></script>
<meta charset="utf-8" name="viewport" content="width=414">
<title>秀家信息</title>
<style type="text/css">
*{
    font-family: "Heiti SC","Hiragino Sans GB";
}
body{
	background-color:#FFF;
	color:#333;
}
.container{
	width:100%;
	height:100%;
	padding:2%;
}
.title{
	text-align:center;
	font-size:1.5rem;
	margin-bottom:30px;
}
.item{
	font-size:1.2rem;
	margin-top:15px;
	margin-bottom:15px;
}
.main_img img{
	max-width:98%;
}
</style>
</head>
<body>
<?php 
require_once("./config/app_webview_config.php");
$id = get_magic_quotes_gpc()?$_GET['id']:addslashes($_GET['id']);
$sql="SELECT `show`.content,`show`.`name`,`show`.space_id,FROM_UNIXTIME(`show`.top_time,'%Y年%m月%d') AS `time`,sys_image.url 
        FROM `show` left join sys_image on sys_image.id = `show`.img_url_id 
        WHERE `show`.id = $id AND `show`.app_return = 1  ";
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_array($result);
$color_row=array();
$style_row=array();
$color_sql="SELECT  grp_color.`name`  FROM  show_color 
            LEFT JOIN grp_color ON show_color.`color_id`=grp_color.id 
            WHERE show_color.`show_id`=$id";
$color_result=mysqli_query($conn, $color_sql);

while ($row1 = mysqli_fetch_row($color_result)) {
$color_row[] = $row1;
}

$style_sql="SELECT grp_style.name FROM show_style  
            LEFT JOIN grp_style ON show_style.`style_id`=grp_style.id 
            WHERE show_style.`show_id`=$id";
$style_result=mysqli_query($conn, $style_sql);

while ($row2 = mysqli_fetch_row($style_result)) {
$style_row[] = $row2;
}

$color_str="";
$style_str="";
for($i=0;$i<count($color_row);$i++){
    for($j=0;$j<count($color_row[$i]);$j++){
         $color_str.=$color_row[$i][$j]." " ;
    }
}


for($i=0;$i<count($style_row);$i++){
    for($j=0;$j<count($style_row[$i]);$j++){         
        $style_str.=$style_row[$i][$j]." " ;
    }
}

?>
<div class="container">
	<div class="title">
    <?php
	echo $row['name'];
    ?>
    </div>
    <div class="item">风格:
    <?php
    echo $style_str;
    ?>
    </div>
    <div class="item">色系:
    <?php
    echo $color_str;
    ?>
    </div>
    <!--<div class="item">时间:
    <?php
	//echo $row['time'];
    ?>
    </div>-->
    <div class="item main_img">
    <?php
	echo "<img src='".$url.$path.$row['url']."'>";
    ?>
    </div>
    <div>
    <?php echo $row['content'];?>
    </div>
</div>
</body>
</html>
